home *** CD-ROM | disk | FTP | other *** search
/ By Popular Request 2.0 / By Popular Request 2.0 (Arsenal Computer).ISO / amiga_6 / tread2_5.lha / dlgul061.lha / Bonus / FTick.rexx < prev    next >
OS/2 REXX Batch file  |  1992-11-21  |  3KB  |  96 lines

  1. /*  FTick.rexx --                               */
  2. /* process new files received via Tick          */
  3.  
  4. parse arg Area' 'Path' 'Orig' 'Farea' 'Desc'FF'X    /* get the parameters from FTick */
  5.  
  6. /* we don't want conflicts with DLGUpload, so we change any "-characters in the
  7.    Description to '-characters */
  8.  
  9. Desc = translate(Desc,"'",'"')
  10.  
  11. if Area = 'IBASE' then do    /* this is our "special-area" which allows our points */
  12.    call Local                /* to upload files to any User/File-Areas via Tick    */
  13.    call Upload               /* all they have to do is specify FILE: or USER: and  */
  14. end                          /* a AreaNumber/User_Name as first part of Desc...    */
  15.  
  16. if Area = 'NODEDIFF' then do /* this will process the nodediff immediately when it */
  17.    call Diff                 /* arrives    */
  18.    call Upload
  19. end
  20.  
  21.  
  22. /* if it's one of those File-Echos, we will make an announcement in our local
  23.    request-area: */
  24.  
  25. if left(Area,3) = 'SKY' | left(Area,3) = 'ADS' | left(Area,4) = 'ANSI' then do
  26.    call Announce
  27.    call Upload
  28. end
  29.  
  30. /* if the file is NOT of any special Area, it will NOW be moved to the BBS */
  31.  
  32. Upload:          /* this calls DLGUpload and moves the File to the BBS */
  33.  
  34. address command 'c:dupload del -f 'Path' -a 'Farea' -d "'Desc'" -u "FTick 0.84 Beta"'
  35.  
  36. exit
  37.  
  38. Local:     /* when we get files in our "special-area", they will now be checked */
  39.  
  40. if translate(left(Desc,5)) = 'USER:' then do      /* is it to a USER ??? */
  41.    parse var Desc dummy ':' UName ' ' NewDesc     /* get his name...     */
  42.    Farea = 'User:'UName
  43.    if ~open(Data,FArea'/User.data','R') then do   /* does User exist ??  */
  44.       NewDesc = 'Error: 'Desc
  45.       FArea = 'User:Marcus_Kuba'              /* if NOT, move it to the SysOp */
  46.    end
  47.    Desc = NewDesc
  48.    return
  49. end
  50.  
  51. if translate(left(Desc,5)) = 'FILE:' then do      /* is it for a file-area ??? */
  52.    parse var Desc dummy ':' Number ' ' NewDesc    /* get the Area-Number       */
  53.    Farea = 'File:'Number
  54.    if ~open(Data,FArea'/User.File','R') then do   /* does area exist ??        */
  55.       NewDesc = 'Fehler: 'Desc
  56.       FArea = 'User:Marcus_Kuba'              /* if NOT, move it to the SysOp  */
  57.    end
  58.    Desc = NewDesc
  59.    return
  60. end
  61.                                 /* if the USER: or FILE:-prefix was wrong or some   */
  62. Farea = 'User:Marcus_Kuba'      /* other problem with this description occured, the */
  63. Desc  = 'Wrong Desc: 'Desc      /* File will be moved to the SysOp, too...          */
  64.  
  65. return
  66.  
  67. /* if the file is in one of the announcement-areas, NOW it will be listed in the body
  68.    of the announcement. Since FTick does not supply a %-switch for the length of the
  69.    file yet, we do it the hard way and use NEWLIST 5.0a's feature of formatted
  70.    listing... (if you know a better way, just tell me :-) */
  71.  
  72. Announce:
  73.  
  74. address command 'c:nl >>t:Newticks -T -h -F "\nFile: %n (%s Bytes), Area: 'Area', Origin: 'Orig'\nDesc: 'Desc'" 'Path
  75.  
  76. return
  77.  
  78. /* ^^^ this will get you something like:
  79.  
  80. File: DLGUL060.lha (2???? Bytes), Area: DLG_PR, Origin: 2:2407/106
  81. Desc: latest version of DLGUpload (0.60), works well with DLG 0.985 and FTick 0.84
  82.  
  83. */
  84.  
  85. /* this one will call your TrapList(or whatever...)-script. It passes along the
  86.    path/filename of the actual nodediff-update-file, so your batch should expect and
  87.    use this parameter !!! */
  88.  
  89. Diff:
  90.  
  91. address command 'execute DLGConfig:Batch/NList2 'Path
  92.  
  93. return
  94.  
  95. exit
  96.